import api from "./";
//验证验证码
export function VerificationCode(phone, captcha) {
  return api({
    method: "POST",
    url: `/captcha/verify`,
    data: {
      phone,
      captcha,
    },
  });
}
//获取验证码
export function getVerification(phone) {
  return api({
    method: "GET",
    url: `/captcha/sent?phone=${phone}`,
  });
}
//手机登录
export function phoneLogin(phone, password) {
  return api({
    method: "POST",
    url: `/login/cellphone`,
    data: {
      phone,
      password,
    },
  });
}
//退出登录
export function logout() {
  return api({
    method: "GET",
    url: `/logout`,
  });
}
//查看登录状态
export function loginStatus() {
  return api({
    method: "GET",
    url: `/login/status?timeout=${new Date().getTime()}`,
  });
}
